﻿CREATE PROCEDURE [dbo].[yaf_user_guest]
AS
    BEGIN
        SELECT TOP 1 a.UserID
        FROM   yaf_User a,
               yaf_UserGroup b,
               yaf_Group c
        WHERE  b.UserID = a.UserID
        AND b.GroupID = c.GroupID
        AND (c.Flags & 2) <> 0
    END


